package com.boss.fileapp.dao.impl;

import com.boss.fileapp.consts.TableName;
import com.boss.fileapp.dao.IAgencyVerifyDao;
import com.boss.framework.dao.BaseDaoImpl;
import com.boss.sys.utils.SysUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class AgencyVerifyDaoImpl extends BaseDaoImpl implements IAgencyVerifyDao {

    @Override
    public List<String> selectSalaryMonth() {
        StringBuilder sb = new StringBuilder();
        sb.append(" select distinct salary_month from ")
                .append(TableName.AGENCY_VERIFY)
                .append(" where is_month_end = 0 and is_thirteen = 0 ");
        return super.getjdbcTemplate().queryForList(sb.toString(), String.class);
    }

    @Override
    public List<Map<String, Object>> getPersonExtByIdenNo(List<String> idennos) {
        StringBuilder sql = new StringBuilder();
        sql.append("select  person_id,iden_no, agency_id, dept_id, agency_code,mof_div_code ");
        sql.append(" from ").append(TableName.PERSON_EXT_SUBMIT)
            .append(" where ")
            .append(SysUtils.inSql("iden_no",idennos));
        return this.getjdbcTemplate().queryForList(sql.toString());
    }
}
